import http from '@/utils/request'

export default {

  // 登录
  async login(payload) {
    return await http.post('login', payload)
  },
  async get(id) {
    return await http.get(`user/${id}`)
  },
  // 获取权限列表
  async getList(listQuery) {
    return await http.get('users', listQuery)
  },
  // 更新权限
  async update(user) {
    return await http.patch('user', user)
  },
  // 新建权限
  async create(bean) {
    return await http.post('user', bean)
  },
  // 删除权限
  async delete(id) {
    return await http.delete(`user/${id}`)
  }
}
